package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.utils.RedisCache;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("userShopController") // userShopController 防止两个同名的ShopController发生冲突
@RequestMapping("/user/shop")
@Api(tags = "店铺操作相关接口")
public class ShopController {

    @Autowired
    private RedisCache redisCache;

    @GetMapping("/status")
    @ApiOperation("获取营业状态")
    public Result getShopStatus(){
        System.out.println("获取营业状态..........");
        String shopStatus = redisCache.getCacheObject("SHOP_STATUS");
        return Result.success(Integer.valueOf(shopStatus));
    }

}
